import axios from "@/utils/request";
import Vue from "vue";

const Api = {
  userGet: "/admin/all-user-info",
  userChange: "/admin/admin-userinfo",
  searchUser: "/admin/searchUser",
  deleteUserinfo: "/admin/userinfo",
  addUser: "/admin/userinfo",
  resetUserPassword: "/admin/reset-password",
};
export function userGet() {
  return axios({
    url: Api.userGet,
    method: "get",
  });
}

export function userChange(parameter) {
  return axios({
    url: Api.userChange,
    method: "put",
    data: parameter,
    
  });
}

export function deleteUserinfo(parameter) {
  return axios({
    url: Api.deleteUserinfo,
    method: "delete",
    params: parameter,
  });
}

export function searchUser(parameter) {
  return axios({
    url: Api.searchUser,
    method: "get",
    params: parameter,
  });
}

export function addUser(parameter) {
  return axios({
    url: Api.addUser,
    method: "post",
    data: parameter,
  });
}

export function resetUserPassword(parameter) {
  console.log(parameter);
  return axios({
    url: Api.resetUserPassword,
    method: "put",
    params: parameter,
  });
}
